import zhipuai,time

zhipuai.api_key = "41805a5412196acfdd9d63a905f9039a.Z0TWy2173NoP1ZkI"
response = zhipuai.model_api.async_invoke(
    model="chatglm_pro",
    prompt=[{"role": "user", "content": "你能干什么"}],
)

task_id = response['data']['task_id']

print(type(task_id))

time.sleep(10)

zhipuai.api_key = "41805a5412196acfdd9d63a905f9039a.Z0TWy2173NoP1ZkI"

result = zhipuai.model_api.query_async_invoke_result(task_id)

print(result)
